<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Bundler::Installer - bundler: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-install">::install</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-ensure_specs_are_compatible-21">#ensure_specs_are_compatible!</a>
    <li ><a href="#method-i-generate_bundler_executable_stubs">#generate_bundler_executable_stubs</a>
    <li ><a href="#method-i-generate_standalone_bundler_executable_stubs">#generate_standalone_bundler_executable_stubs</a>
    <li ><a href="#method-i-install">#install</a>
    <li ><a href="#method-i-install_in_parallel">#install_in_parallel</a>
    <li ><a href="#method-i-installation_parallelization">#installation_parallelization</a>
    <li ><a href="#method-i-load_plugins">#load_plugins</a>
    <li ><a href="#method-i-lock">#lock</a>
    <li ><a href="#method-i-resolve_if_needed">#resolve_if_needed</a>
    <li ><a href="#method-i-run">#run</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Bundler::Installer">
    <h1 id="class-Bundler::Installer" class="class">
      class Bundler::Installer
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-c-ambiguous_gems" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">ambiguous_gems</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-definition" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">definition</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-post_install_messages" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">post_install_messages</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-install" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install</span><span
                                class="method-args">(root, definition, options = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Begins the installation process for <a href="../Bundler.html"><code>Bundler</code></a>. For more information see the <a href="Installer.html#method-i-run"><code>run</code></a> method on this class.</p>

                              <div class="method-source-code" id="install-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 20</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">install</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">definition</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">installer</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">definition</span>)
  <span class="ruby-constant">Plugin</span>.<span class="ruby-identifier">hook</span>(<span class="ruby-constant">Plugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Events</span><span class="ruby-operator">::</span><span class="ruby-constant">GEM_BEFORE_INSTALL_ALL</span>, <span class="ruby-identifier">definition</span>.<span class="ruby-identifier">dependencies</span>)
  <span class="ruby-identifier">installer</span>.<span class="ruby-identifier">run</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-constant">Plugin</span>.<span class="ruby-identifier">hook</span>(<span class="ruby-constant">Plugin</span><span class="ruby-operator">::</span><span class="ruby-constant">Events</span><span class="ruby-operator">::</span><span class="ruby-constant">GEM_AFTER_INSTALL_ALL</span>, <span class="ruby-identifier">definition</span>.<span class="ruby-identifier">dependencies</span>)
  <span class="ruby-identifier">installer</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(root, definition)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 28</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">definition</span>)
  <span class="ruby-ivar">@root</span> = <span class="ruby-identifier">root</span>
  <span class="ruby-ivar">@definition</span> = <span class="ruby-identifier">definition</span>
  <span class="ruby-ivar">@post_install_messages</span> = {}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-generate_bundler_executable_stubs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">generate_bundler_executable_stubs</span><span
                                class="method-args">(spec, options = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="generate_bundler_executable_stubs-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 98</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_bundler_executable_stubs</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:binstubs_cmd</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">executables</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-identifier">options</span> = {}
    <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">runtime_dependencies</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dep</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">bins</span> = <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">specs</span>[<span class="ruby-identifier">dep</span>].<span class="ruby-identifier">first</span>.<span class="ruby-identifier">executables</span>
      <span class="ruby-identifier">options</span>[<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">bins</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bins</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">any?</span>
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;#{spec.name} has no executables, but you may want &quot;</span> \
        <span class="ruby-string">&quot;one from a gem it depends on.&quot;</span>
      <span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">bins</span><span class="ruby-operator">|</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;  #{name} has: #{bins.join(&quot;, &quot;)}&quot;</span> }
    <span class="ruby-keyword">else</span>
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;There are no executables for the gem #{spec.name}.&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># double-assignment to avoid warnings about variables that will be used by ERB</span>
  <span class="ruby-identifier">bin_path</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">bin_path</span>
  <span class="ruby-identifier">bin_path</span> = <span class="ruby-identifier">bin_path</span>
  <span class="ruby-identifier">relative_gemfile_path</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">default_gemfile</span>.<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-identifier">bin_path</span>)
  <span class="ruby-identifier">relative_gemfile_path</span> = <span class="ruby-identifier">relative_gemfile_path</span>
  <span class="ruby-identifier">ruby_command</span> = <span class="ruby-constant">Thor</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">ruby_command</span>
  <span class="ruby-identifier">ruby_command</span> = <span class="ruby-identifier">ruby_command</span>
  <span class="ruby-identifier">template_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;templates/Executable&quot;</span>, <span class="ruby-identifier">__dir__</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;bundler&quot;</span>
    <span class="ruby-identifier">template_path</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;.bundler&quot;</span>
    <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">executables</span> = <span class="ruby-string">%(bundle)</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">template_path</span>)

  <span class="ruby-identifier">exists</span> = []
  <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">executables</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">executable</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">binstub_path</span> = <span class="ruby-node">&quot;#{bin_path}/#{executable}&quot;</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">binstub_path</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-value">:force</span>]
      <span class="ruby-identifier">exists</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">executable</span>
      <span class="ruby-keyword">next</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">mode</span> = <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">win_platform?</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot;wb:UTF-8&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;w&quot;</span>
    <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;erb&quot;</span>
    <span class="ruby-identifier">content</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">template</span>, <span class="ruby-value">:trim_mode</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;-&quot;</span>).<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)

    <span class="ruby-constant">File</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">binstub_path</span>, <span class="ruby-identifier">content</span>, <span class="ruby-value">:mode</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">mode</span>, <span class="ruby-value">:perm</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">0o777</span> <span class="ruby-operator">&amp;</span> <span class="ruby-operator">~</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">umask</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">win_platform?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:all_platforms</span>]
      <span class="ruby-identifier">prefix</span> = <span class="ruby-string">&quot;@ruby -x \&quot;%~f0\&quot; %*\n@exit /b %ERRORLEVEL%\n\n&quot;</span>
      <span class="ruby-constant">File</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;#{binstub_path}.cmd&quot;</span>, <span class="ruby-identifier">prefix</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">content</span>, <span class="ruby-value">:mode</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">mode</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:binstubs_cmd</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">exists</span>.<span class="ruby-identifier">any?</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">exists</span>.<span class="ruby-identifier">size</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">1</span>
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;Skipped #{exists[0]} since it already exists.&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">2</span>
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;Skipped #{exists.join(&quot; and &quot;)} since they already exist.&quot;</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">items</span> = <span class="ruby-identifier">exists</span>[<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">exists</span>[<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-value">-1</span>].<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;, &quot;</span>)
      <span class="ruby-identifier">skipped</span> = [<span class="ruby-identifier">items</span>, <span class="ruby-identifier">exists</span>[<span class="ruby-value">-1</span>]].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot; and &quot;</span>)
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;Skipped #{skipped} since they already exist.&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;If you want to overwrite skipped stubs, use --force.&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-generate_standalone_bundler_executable_stubs" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">generate_standalone_bundler_executable_stubs</span><span
                                class="method-args">(spec, options = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="generate_standalone_bundler_executable_stubs-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 163</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_standalone_bundler_executable_stubs</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-comment"># double-assignment to avoid warnings about variables that will be used by ERB</span>
  <span class="ruby-identifier">bin_path</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">bin_path</span>
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">path</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:path</span>]
    <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;Can&#39;t standalone without an explicit path set&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">standalone_path</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">root</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-identifier">bin_path</span>)
  <span class="ruby-identifier">standalone_path</span> = <span class="ruby-identifier">standalone_path</span>
  <span class="ruby-identifier">template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;templates/Executable.standalone&quot;</span>, <span class="ruby-identifier">__dir__</span>))
  <span class="ruby-identifier">ruby_command</span> = <span class="ruby-constant">Thor</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">ruby_command</span>
  <span class="ruby-identifier">ruby_command</span> = <span class="ruby-identifier">ruby_command</span>

  <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">executables</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">executable</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">executable</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;bundle&quot;</span>
    <span class="ruby-identifier">executable_path</span> = <span class="ruby-constant">Pathname</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">full_gem_path</span>).<span class="ruby-identifier">join</span>(<span class="ruby-identifier">spec</span>.<span class="ruby-identifier">bindir</span>, <span class="ruby-identifier">executable</span>).<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-identifier">bin_path</span>)
    <span class="ruby-identifier">executable_path</span> = <span class="ruby-identifier">executable_path</span>

    <span class="ruby-identifier">mode</span> = <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">win_platform?</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot;wb:UTF-8&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;w&quot;</span>
    <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;erb&quot;</span>
    <span class="ruby-identifier">content</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">template</span>, <span class="ruby-value">:trim_mode</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;-&quot;</span>).<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)

    <span class="ruby-constant">File</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;#{bin_path}/#{executable}&quot;</span>, <span class="ruby-identifier">content</span>, <span class="ruby-value">:mode</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">mode</span>, <span class="ruby-value">:perm</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-value">0o755</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-constant">Gem</span>.<span class="ruby-identifier">win_platform?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:all_platforms</span>]
      <span class="ruby-identifier">prefix</span> = <span class="ruby-string">&quot;@ruby -x \&quot;%~f0\&quot; %*\n@exit /b %ERRORLEVEL%\n\n&quot;</span>
      <span class="ruby-constant">File</span>.<span class="ruby-identifier">write</span>(<span class="ruby-node">&quot;#{bin_path}/#{executable}.cmd&quot;</span>, <span class="ruby-identifier">prefix</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">content</span>, <span class="ruby-value">:mode</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">mode</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-run" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">run</span><span
                                class="method-args">(options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Runs the install procedures for a specific Gemfile.</p>

<p>Firstly, this method will check to see if ‘Bundler.bundle_path` exists and if not then <a href="../Bundler.html"><code>Bundler</code></a> will create the directory. This is usually the same location as RubyGems which typically is the `~/.gem` directory unless other specified.</p>

<p>Secondly, it checks if <a href="../Bundler.html"><code>Bundler</code></a> has been configured to be “frozen”. Frozen ensures that the Gemfile and the Gemfile.lock file are matching. This stops a situation where a developer may update the Gemfile but may not run ‘bundle install`, which leads to the Gemfile.lock file not being correctly updated. If this file is not correctly updated then any other developer running `bundle install` will potentially not install the correct gems.</p>

<p>Thirdly, <a href="../Bundler.html"><code>Bundler</code></a> checks if there are any dependencies specified in the Gemfile. If there are no dependencies specified then <a href="../Bundler.html"><code>Bundler</code></a> returns a warning message stating so and this method returns.</p>

<p>Fourthly, <a href="../Bundler.html"><code>Bundler</code></a> checks if the Gemfile.lock exists, and if so then proceeds to set up a definition based on the Gemfile and the Gemfile.lock. During this step <a href="../Bundler.html"><code>Bundler</code></a> will also download information about any new gems that are not in the Gemfile.lock and resolve any dependencies if needed.</p>

<p>Fifthly, <a href="../Bundler.html"><code>Bundler</code></a> resolves the dependencies either through a cache of gems or by remote. This then leads into the gems being installed, along with stubs for their executables, but only if the –binstubs option has been passed or <a href=":bin">Bundler.options</a> has been set earlier.</p>

<p>Sixthly, a new Gemfile.lock is created from the installed gems to ensure that the next time that a user runs ‘bundle install` they will receive any updates from this process.</p>

<p>Finally, if the user has specified the standalone flag, <a href="../Bundler.html"><code>Bundler</code></a> will generate the needed require paths and save them in a ‘setup.rb` file. See `bundle standalone –help` for more information.</p>

                              <div class="method-source-code" id="run-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 68</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">run</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">create_bundle_path</span>

  <span class="ruby-constant">ProcessLock</span>.<span class="ruby-identifier">lock</span> <span class="ruby-keyword">do</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">frozen_bundle?</span>
      <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">ensure_equivalent_gemfile_and_lockfile</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:deployment</span>])
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;The Gemfile specifies no dependencies&quot;</span>
      <span class="ruby-identifier">lock</span>
      <span class="ruby-keyword">return</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">resolve_if_needed</span>(<span class="ruby-identifier">options</span>)
      <span class="ruby-identifier">ensure_specs_are_compatible!</span>
      <span class="ruby-identifier">load_plugins</span>
      <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:jobs</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">options</span>[<span class="ruby-value">:jobs</span>] = <span class="ruby-value">1</span> <span class="ruby-comment"># to avoid the overhead of Bundler::Worker</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">install</span>(<span class="ruby-identifier">options</span>)

    <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Specification</span>.<span class="ruby-identifier">reset</span> <span class="ruby-comment"># invalidate gem specification cache so that installed gems are immediately available</span>

    <span class="ruby-identifier">lock</span>
    <span class="ruby-constant">Standalone</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>[<span class="ruby-value">:standalone</span>], <span class="ruby-ivar">@definition</span>).<span class="ruby-identifier">generate</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-value">:standalone</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-ensure_specs_are_compatible-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ensure_specs_are_compatible!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ensure_specs_are_compatible-21-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 230</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ensure_specs_are_compatible!</span>
  <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">specs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">matches_current_ruby?</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">InstallError</span>, <span class="ruby-node">&quot;#{spec.full_name} requires ruby version #{spec.required_ruby_version}, &quot;</span> \
        <span class="ruby-node">&quot;which is incompatible with the current version, #{Gem.ruby_version}&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-identifier">spec</span>.<span class="ruby-identifier">matches_current_rubygems?</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">InstallError</span>, <span class="ruby-node">&quot;#{spec.full_name} requires rubygems version #{spec.required_rubygems_version}, &quot;</span> \
        <span class="ruby-node">&quot;which is incompatible with the current version, #{Gem.rubygems_version}&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install</span><span
                                class="method-args">(options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>the order that the resolver provides is significant, since dependencies might affect the installation of a gem. that said, it’s a rare situation (other than rake), and parallel installation is SO MUCH FASTER. so we let people opt in.</p>

                              <div class="method-source-code" id="install-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 198</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">force</span> = <span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;force&quot;</span>]
  <span class="ruby-identifier">jobs</span> = <span class="ruby-identifier">installation_parallelization</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">install_in_parallel</span> <span class="ruby-identifier">jobs</span>, <span class="ruby-identifier">options</span>[<span class="ruby-value">:standalone</span>], <span class="ruby-identifier">force</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install_in_parallel" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_in_parallel</span><span
                                class="method-args">(size, standalone, force = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_in_parallel-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 243</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_in_parallel</span>(<span class="ruby-identifier">size</span>, <span class="ruby-identifier">standalone</span>, <span class="ruby-identifier">force</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">spec_installations</span> = <span class="ruby-constant">ParallelInstaller</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword">self</span>, <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">specs</span>, <span class="ruby-identifier">size</span>, <span class="ruby-identifier">standalone</span>, <span class="ruby-identifier">force</span>)
  <span class="ruby-identifier">spec_installations</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">installation</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">post_install_messages</span>[<span class="ruby-identifier">installation</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">installation</span>.<span class="ruby-identifier">post_install_message</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">installation</span>.<span class="ruby-identifier">has_post_install_message?</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-installation_parallelization" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">installation_parallelization</span><span
                                class="method-args">(options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="installation_parallelization-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 204</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">installation_parallelization</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">jobs</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:jobs</span>)
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">jobs</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">jobs</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:jobs</span>]
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">jobs</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>.<span class="ruby-identifier">processor_count</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-load_plugins" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_plugins</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="load_plugins-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 216</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_plugins</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">load_plugins</span>

  <span class="ruby-identifier">requested_path_gems</span> = <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">requested_specs</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">source</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Source</span><span class="ruby-operator">::</span><span class="ruby-constant">Path</span>) }
  <span class="ruby-identifier">path_plugin_files</span> = <span class="ruby-identifier">requested_path_gems</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">spec</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">spec_matches_for_glob</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-node">&quot;rubygems_plugin#{Bundler.rubygems.suffix_pattern}&quot;</span>)
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">TypeError</span>
    <span class="ruby-identifier">error_message</span> = <span class="ruby-node">&quot;#{spec.name} #{spec.version} has an invalid gemspec&quot;</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">InvalidSpecificationException</span>, <span class="ruby-identifier">error_message</span>
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">flatten</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">load_plugin_files</span>(<span class="ruby-identifier">path_plugin_files</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">load_env_plugins</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-lock" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">lock</span><span
                                class="method-args">(opts = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="lock-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 263</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">lock</span>(<span class="ruby-identifier">opts</span> = {})
  <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">lock</span>(<span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">default_lockfile</span>, <span class="ruby-identifier">opts</span>[<span class="ruby-value">:preserve_unknown_sections</span>])
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_if_needed" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_if_needed</span><span
                                class="method-args">(options)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>returns whether or not a re-resolve was needed</p>

                              <div class="method-source-code" id="resolve_if_needed-source">
            <pre><span class="ruby-comment"># File bundler/installer.rb, line 251</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_if_needed</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">resolution_mode</span> = <span class="ruby-identifier">options</span>

  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">unlocking?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>[<span class="ruby-string">&quot;force&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:inline</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">default_lockfile</span>.<span class="ruby-identifier">file?</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">nothing_changed?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">missing_specs?</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@definition</span>.<span class="ruby-identifier">setup_sources_for_resolve</span>

  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

